from matplotlib import pyplot as plt
import pandas as pd
from matplotlib import font_manager
import numpy as np

font = font_manager.FontProperties(fname='C:\Windows\Fonts\仿宋_GB2312.ttf')

plt.figure(figsize=(200, 80), dpi=80)

df =pd.read_excel('D:/pythonproject/matplotlib/bar/khpj.xls')
x=df.columns[2:]
y=df.iloc[0,2:]

xx = range(0,len(x))


plt.barh(xx,y)
plt.yticks(range(0,len(x),5),["{0}".format(x[i]) for i in xx],rotation='0',fontproperties=font)
#plt.tick_params(axis='y', labelsize=8)
plt.show()